/* 全局样式 */
:root {
    --primary-color: #03A9F4;
    --secondary-color: #0288D1;
    --accent-color: #FF4081;
    --text-color: #333;
    --light-text: #fff;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.btn-secondary {
    background-color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: #E91E63;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* 登录注册页面样式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #71b7e6, #9b59b6);
}

.auth-card {
    width: 400px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 20px;
    text-align: center;
    font-size: 24px;
}

.auth-body {
    padding: 30px;
}

.auth-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
}

.auth-switch {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

/* 用户列表页面样式 */
.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.user-card {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-text);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    margin-right: 15px;
}

.user-info {
    flex-grow: 1;
}

.user-name {
    font-weight: bold;
    margin-bottom: 5px;
}

/* 聊天界面样式 */
.chat-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 300px;
    background-color: var(--card-bg);
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--light-text);
}

.search-box {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.chat-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-item:hover {
    background-color: #f9f9f9;
}

.chat-item.active {
    background-color: #e3f2fd;
}

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    background-color: var(--card-bg);
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

/* 消息容器样式 */
.message-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    width: 100%;
}

.message-container.sent {
    justify-content: flex-end;
}

.message-container.received {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    margin: 0 10px;
}

.message-content-container {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.message-username {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: bold;
}

.message {
    margin-bottom: 3px;
    max-width: 100%;
}

.message-sent {
    background-color: var(--primary-color);
    color: var(--light-text);
    border-radius: 18px 18px 0 18px;
    padding: 10px 15px;
    align-self: flex-end;
}

.message-received {
    background-color: var(--card-bg);
    border-radius: 18px 18px 18px 0;
    padding: 10px 15px;
    box-shadow: var(--shadow);
    align-self: flex-start;
}

.message-info {
    font-size: 12px;
    margin-top: 5px;
    color: #888;
}

.chat-input {
    padding: 15px;
    background-color: var(--card-bg);
    border-top: 1px solid #eee;
    display: flex;
}

.chat-input input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    margin-right: 10px;
}

.chat-input button {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.5s ease forwards;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
    }
    
    .user-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .auth-card {
        width: 90%;
    }
} 